package command;

import java.util.HashMap;
import java.util.Map;

import impl.AddCommand;
import impl.DeleteCommand;
import impl.ExitCommand;
import impl.HelpCommand;
import impl.ListCommand;
import impl.SelectCommand;

public class SystemCommandFactory extends CommandFactory {

	private static Map<CommandCode, Command> commandMap = new HashMap<>();

	static {
		commandMap.put(CommandCode.EXIT, new ExitCommand());
		commandMap.put(CommandCode.HELP, new HelpCommand());
		commandMap.put(CommandCode.LIST, new ListCommand());
		commandMap.put(CommandCode.ADD, new AddCommand());
		commandMap.put(CommandCode.DELETE, new DeleteCommand());
		commandMap.put(CommandCode.SELECT, new SelectCommand());
	}

	public Command buildCommand(CommandCode cmd) {
		Command comm = commandMap.get(cmd);
		return comm;
	}

}
